<?php
/** 
 * 
 * FCKeditor编辑器封装
 * @author 余风
 * @version 0.1
 * 
 */
class CsmEditor extends Think{
	
	private $fck = NULL;
	
	private $basePath = '';
	/**
	 * 
	 * 构造方法
	 * @param string $fname
	 * @param mixed $fvalue
	 * @param mixed $nheight
	 * @param mixed $etype
	 * @param mixed $isfullpage
	 * 
	 * @return object
	 */
	function __construct() {
		$this->basePath = PUBLIC_URL.'/ckeditor/';
		import('ckeditor_php5',PUBLIC_PATH.'/ckeditor','.php');
		$fck = new CKEditor($this->basePath);
		$fck->config['height'] = 300;
		$fck->config['width'] = 870;
		$fck->config['uiColor'] = '#f6f6f2';
		$fck->config['toolbarLocation'] = 'top';
		$fck->config['toolbar'] = 'Full';
		$fck->returnOutput = true;
		$this->fck = &$fck;
	}
	
	/**
	 * 
	 * 创建编辑器
	 * @access public
	 */
	public function createEditor(){
		
	}
		
	/**
	 * 
	 * 生成编辑器HTML代码
	 * @access public
	 * @return string
	 *
	 */
	public function createHtml($name, $value = "", $config = array(), $events = array()){
		$config = $this->fck->config;
		return $this->fck->editor($name, $value, $config, $events);
	}
	
	
}

?>